{%- extends 'index.html' -%}
{%- block nav -%}
	<div class="navbar navbar-default navbar-fixed-top"></div>
{%- endblock -%}
{%- block body -%}
    <div class="post clearfix">
        <div class="row">
            <div class="col-lg-8">
                <div class="page-header">
                    <h1>Welcome to Install Page!</h1>
                </div>
                <div class="content">
                    {%- with messages = get_flashed_messages(with_categories=True) -%}
                        {%- if messages -%}
                            {%- for category, message in messages -%}
                                <div class="response">
                                    <span class="message {{ category }}">{%- if category == 'success' -%}✔{%- endif -%}&nbsp;{{ message }}</span>
                                </div>
                            {%- endfor -%}
                        {%- endif -%}
                    {%- endwith -%}

	                <form role="form" method="post" action="{{ url_for('install') }}">
                        <fieldset>
	                        <legend>Blog section</legend>
                            <div class="form-group {% if error and error_type == 'validate' %}has-error{% endif %}">
	                            {%- if error and error_type == 'validate' -%}
	                                <label class="control-label" for="blog-title">Required field</label>
	                            {%- endif -%}
	                            <input type="text" class="form-control" name="blog-title" id="blog-title" placeholder="Blog Title" required autocomplete="off">
	                        </div>
                            <div class="form-group">
	                            <input type="text" class="form-control" name="blog-description" id="blog-description" placeholder="Blog Description" autocomplete="off">
	                        </div>
	                        <div class="form-group {% if error and error_type == 'validate' %}has-error{% endif %}">
	                            {%- if error and error_type == 'validate' -%}
	                                <label class="control-label" for="blog-perpage">Required field</label>
	                            {%- endif -%}
	                            <input type="number" min="1" class="form-control" name="blog-perpage" id="blog-perpage" placeholder="Posts per page (default {{ default_settings['PER_PAGE'] }})" required autocomplete="off">
	                        </div>
                            <div class="checkbox">
							    <label>
							        <input type="checkbox" name="blog-text-search" disabled> Use <abbr title="MongoDB version 2.4.6 with textSearchEnabled=true required. Otherwise $regex search will be used."> Text Search</abbr>
							    </label>
						    </div>
                        </fieldset>
	                    <fieldset>
	                        <legend>User section</legend>
		                    <div class="form-group {% if error and error_type == 'validate' %}has-error{% endif %}">
								{%- if error and error_type == 'validate' -%}
									<label class="control-label" for="user-id">Required field</label>
								{%- endif -%}
							    <input type="text" class="form-control" name="user-id" id="user-id" placeholder="Username" value="" required autocomplete="off">
							</div>
							<div class="form-group {% if error and error_type == 'validate' %}has-error{% endif %}">
								{%- if error and error_type == 'validate' -%}
									<label class="control-label" for="user-email">Required field</label>
								{%- endif -%}
							    <input type="email" class="form-control" name="user-email" id="user-email" placeholder="Email" value="" required autocomplete="off">
							</div>
	                        <div class="form-group {% if error and error_type == 'validate' %}has-error{% endif %}">
								{%- if error and error_type == 'validate' -%}
									<label class="control-label" for="user-new-password">Required field</label>
								{%- endif -%}
							    <input type="password" class="form-control" name="user-new-password" id="user-new-password" placeholder="Password" value="" required autocomplete="off">
							</div>
							<div class="form-group {% if error and error_type == 'validate' %}has-error{% endif %}">
								{%- if error and error_type == 'validate' -%}
									<label class="control-label" for="user-new-password-again">Required field</label>
								{%- endif -%}
							    <input type="password" class="form-control" name="user-new-password-again" id="user-new-password-again" placeholder="Repeat Password" value="" required autocomplete="off">
							</div>
                        </fieldset>
                        <div class="form-group">
                            <input name="_csrf_token" type="hidden" value="{{ csrf_token() }}">
                            <input type="submit" class="btn btn-primary" value="Submit">
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
{%- endblock -%}
